import urllib
import urllib.request as urllib2
import json

class Data:
    def __init__(self):
        pass
    def urldata(self):
        return urllib.parse.urlencode(self.__dict__)
class Router:
    url = "http://127.0.0.1:8080"
    def __init__(self,path):
        self.path = Router.url+"/"+path
    def handle(self,h):
        return self.path+"/"+h

def Req(req):
    response = urllib2.urlopen(req)
    
    res = json.load(response,encoding='utf-8')
    if res != None:
        print(json.dumps(res["data"],indent=2))

def main():
    r = Router("list")
    Req(r.path)
if __name__ == "__main__":
    main()